<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>map</title>
</head>
<body>
  <script>
    //声明 Map
    let m = new Map()

    //添加元素
    m.set('name', '尚硅谷')
    m.set('change', function () {
      console.log('我们可以改变你!!')
    })
    let key = {
      school: 'ATGUIGU',
    }
    m.set(key, ['北京', '上海', '深圳'])

    //size  获取长度
    // console.log(m.size)

    //删除
    // m.delete('name')

    //获取
    // console.log(m.get('change'))
    // console.log(m.get(key))

    //清空
    // m.clear()

    //遍历
    for (let v of m) {
      console.log(v)
    }

    console.log(m)
  </script>
</body>
</html>